#唐门优测
#道长最帅666

""
"@pytest.fixture(scope=class)"
"类级别所有用例只运行一次"

"场景一"
import pytest

# @pytest.fixture(scope='class')
# def login_311():
#     print("scope为class")
#
#
# class TestLogin:
#
#     def test_1(self,login_311):
#         print("用例1")
#
#     def test_2(self,login_311):
#         print("用例2")
#
#     def test_3(self,login_311):
#         print("用例3")
#
# if __name__ == '__main__':
#     pytest.main()

"场景二"
"从第一次调用的函数后面开始执行"
@pytest.fixture(scope='class')
def login_311():
    a = '123'
    print("输入账号密码")

class TestLogin:

    def test_1(self):
        print("用例1")

    def test_2(self,login_311):
        print("用例2")

    def test_3(self,login_311):
        print("用例3")

    def test_4(self):
        print("用例4")

if __name__ == '__main__':
    pytest.main()
